﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace wamr.Worker
{
    public abstract class ManagerTask
    {
        public enum TaskDispositionEnum {WAIT, FAIL, PROCEED, NONE, DELETE, COMPLETE};

        public abstract bool PreConditionsMet();
        public abstract bool Initiate();
        public abstract bool Status();
        public abstract void ResolveDependency();

        private TaskDispositionEnum _taskDisposition = TaskDispositionEnum.NONE;
        public TaskDispositionEnum TaskDisposition
        {
            get { return _taskDisposition; }
            set { _taskDisposition = value; }
        }

        // some tasks are dependency for others, before they can run
        private string _dependency = null;
        public string Dependency
        {
            get { return _dependency; }
            set { _dependency = value; }
        }

        // some tasks depend on others to complete first
        private string _dependson = null;
        public string DependsOn
        {
            get { return _dependson; }
            set { _dependson = value; }
        }

        // message validity flag
        public bool MessageIsValid { get; set; }

        private string _taskType = null;
        public string TaskType
        {
            get { return _taskType; }
            set { _taskType = value; }
        }
    }
}
